package org.example.easybuy.util;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler(value={RuntimeException.class})
    public CustomResult handlerRuntimeException(RuntimeException e)
    {
        return CustomResult.errorResult(666,e.getMessage());
    }
}
